package subumbo.leg.view
{
	import flash.display.Bitmap;
	
	import org.osflash.signals.Signal;
	
	import subumbo.leg.controller.signal.StateChangeSignal;
	import subumbo.leg.model.vo.ResizeVO;
	
	/**
	 * Defines the the API exposed by a mediated view component within Robot Legs framework 
	 * @author pwolleb
	 * 
	 */	
	public interface IViewComponent
	{
		/** 
		 *	Shows ViewComponent 
		 */		
		function show():void;
		
		/**
		 *  Hides ViewComponent 
		 */		
		function hide():void;
		
		/**
		 * The method is called on a stage resize.
 		 * @param resizeVO
		 */		
		function resize(resizeVO:ResizeVO):void;
		
		/**
		 * fixedUpdate is called on a flash.utils.Timer interval via the global FixedUpdateSignal
		 */	
		function fixedUpdate():void;
		
		/**
		 * Render is called on EVENT.ENTER_FRAME via the global RenderSignal
		 * @param dt Delta time in milliseconds is the time passed since the last update call; 
		 */		
		function render(dt:Number):void;
		
		/**
		 * Rasterize returns a bitmap of the current state of the component. Bitmap data of this bitmap won't be disposed when the view gets destroyed.
		 * @return 
		 */		
		function rasterize():Bitmap;
		
		/**
		 * Destroy gets called when the view component is removed from stage. 
		 */		
		function destroy():void;
		
		/**
		 * Called when mediator registers. StateChangeSignal should be dispatched on internal state change
		 * @param val 
		 */		
		function set stateChangeSignal(val:StateChangeSignal):void;
	}
}